package com.kfm.bootdemo.controller;

import com.kfm.bootdemo.model.Student;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

//@Controller
// @RestController  表示类里面可以接收请求 同时方法返回值直接响应给客户端
@RestController
public class ResponseBodyTestController {

    @RequestMapping("/test1")
    public Student test1() {
        return new Student();
    }


    @RequestMapping("/test2")
    public String test2() {
        return "我是test2";
    }
}
